<?php

/**
 * User:ayou chow
 * Date: 2019-12-02
 * Time: 10:39
 */

namespace app\common\model;

use think\Model;

class AnchorFansModel extends Model
{
    protected $connection = 'db_live';

    public function anchor()
    {
        return $this->hasOne(UserModel::class, 'id', 'anchorid')->with(['profile', 'live'])->field("id, nick_name, is_anchor, avatar");
    }

    public function fan()
    {
        return $this->hasOne(UserModel::class, 'id', 'fansid')->with('profile')->field("id, nick_name, is_anchor, avatar");
    }
}
